<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="./js/jquery-2.1.0.js"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/Global.js"></script>
    <style>
        .wrap {
            padding: 20px;
            width: 100%;
            overflow: auto;
            box-sizing: border-box;
        }

        ul {
            width: 100%;
        }

        ul li {
            width: 25%;
            float: left;
            height: 36px;
            line-height: 36px;
            /* background: #ccc; */
            text-align: center;
            box-sizing: border-box;
            border: 1px solid #ccc;
            border-top: 0px;
            cursor: pointer;
        }

        ul li:first-of-type {
            border: 1px solid #ccc;
        }

        ul li:nth-of-type(2) {
            border: 1px solid #ccc;
            border-left: 0px;

        }

        ul li:nth-of-type(3) {
            border: 1px solid #ccc;
            border-left: 0px;

        }

        ul li:nth-of-type(4) {
            border: 1px solid #ccc;
            border-left: 0px;

        }

        .winbody {
            width: 700px;
            padding: 10px;
            display: none;
        }

        .carlist {
            width: 120px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            font-size: 14px;
            display: inline-block;
        }

        .tabs {
            /* width: 900px; */
        }

        .tabs a {
            width: 120px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            font-size: 14px;
            display: inline-block;
        }

        .layui-form-item {
            margin: 0;
        }

        .layui-input-inline {
            width: 100% !important;
        }
    </style>
</head>

<body>
    <div class="wrap">
        <table class="layui-table">
            <thead>
                <tr>
                    <th>序号</th>
                    <th>日期</th>
                    <th>服务项目</th>
                    <th>数量</th>
                    <th>金额</th>
                    <th>单位</th>
                    <th>备注</th>
                    <th>经办人</th>
                </tr>
            </thead>
            <tbody class="fybj">

            </tbody>
        </table>
    </div>

</body>
<script>

    $.ajax({
        url: `${API}/erpProject/getProject`,
        type: 'get',
        success: function (res) {
            let arr = res.data
            let str = ''
            $.each(arr, function (j, json) {
                let date = new Date(json.projectDate).getFullYear() + '-' + (new Date(json.projectDate).getMonth() + 1) + '-' + new Date(json.projectDate).getDate()
                let bz = ''
                $.each(json.projectLists, function (i) {
                    bz += ` ${json.projectLists[i].projectName}  ${json.projectLists[i].projectCount} `
                })
                str += `<tr>
                    <td>${j + 1}</td>
                    <td>${date}</td>
                    <td>${json.projectName}</td>
                    <td>${json.projectNum}</td>
                    <td>${json.projectMoney} </td>
                    <td>${json.projectUnit}</td>
                    <td>${bz}</td>
                    <td>
                       ${json.projectAttn}
                    </td>
                </tr>`
            })

            $('.fybj').append(str)
        }
    })

</script>